//program to move even numbers to the front of the array

import java.util.*;
public class MoveInt {
	public static void main(String args[])
	
	{
		
		int j=4;
		int k=0;
		
		int[] newarr=new int[5];
		
		int[] arr={21,35,346,67,18};
		
		for(int i=0; i<arr.length; i++)
		{
			if (arr[i]%2==1)
			{
				newarr[j]=arr[i];
				j--;
			}
			else 
			{
				newarr[k]=arr[i];
				k++;
			}
						
		}
		System.out.println("array with even numbers first is " + Arrays.toString(newarr));

	}
}
